{include file=comm/head.html}

{include file=comm/top.html}

<div class="container pages">
	{include file=comm/position.html}
    
    <div class="row">
			<div class="col-md-2">
				<img class="card card-img-top" src="{content:ext_photo}" alt="{content:title}">
			</div>
            
        	<div class="col-md-10 mb-3 pr-3 mt-3">
            	<h2 class="pb-2 fs-sm-16 fs-16"><b>{content:title}</b></h2>
                
                <div class="text-secondary my-3 border-bottom-dashed lh-3">
                      	<b>姓名：{content:ext_name}</b>
                </div>
                
                <div class="text-secondary my-3 border-bottom-dashed lh-3">
                     	學歷：{content:ext_education}
                </div>               
				<div class="text-secondary my-3 border-bottom-dashed lh-3">
                     	專長：{content:ext_expertise}
                </div>
				<div class="text-secondary my-3 border-bottom-dashed lh-3">
				     	經驗：{content:ext_experience}
				</div>
                <div class="my-3 lh-3">
                	{pboot:sort scode=11}
                     <a href="[sort:link]" class="btn btn-danger">馬上諮詢</a>
                    {/pboot:sort}
                </div>
            </div>
      </div>
      
      <h5 class="border-bottom border-info pb-2 mb-2"><i class="fa fa-sliders" aria-hidden="true"></i> 老師簡介</h5>
      <div class="content">{content:content}</div>
      
      <div class="text-secondary lh-2 mt-3">
			<p>上一篇：{content:precontent}</p>
			<p>下一篇：{content:nextcontent}</p>
      </div>
</div>

{include file=comm/comment.html}
    

<script src="{pboot:sitetplpath}/swiper-4.3.5/js/swiper.min.js"></script>
<script>
var viewSwiper = new Swiper('.view .swiper-container', {
	on:{
		slideChangeTransitionStart: function() {
		    updateNavPosition()
	    }
	}
})

$('.view .arrow-left,.preview .arrow-left').on('click', function(e) {
	e.preventDefault()
	if (viewSwiper.activeIndex == 0) {
		viewSwiper.slideTo(viewSwiper.slides.length - 1, 1000);
		return
	}
	viewSwiper.slidePrev()
})
$('.view .arrow-right,.preview .arrow-right').on('click', function(e) {
	e.preventDefault()
	if (viewSwiper.activeIndex == viewSwiper.slides.length - 1) {
		viewSwiper.slideTo(0, 1000);
		return
	}
	viewSwiper.slideNext()
})

var previewSwiper = new Swiper('.preview .swiper-container', {
	//visibilityFullFit: true,
	slidesPerView: 'auto',
	allowTouchMove: false,
	on:{
		tap: function() {
		    viewSwiper.slideTo(previewSwiper.clickedIndex)
	  }
	}
})

function updateNavPosition() {
		$('.preview .active-nav').removeClass('active-nav')
		var activeNav = $('.preview .swiper-slide').eq(viewSwiper.activeIndex).addClass('active-nav')
		if (!activeNav.hasClass('swiper-slide-visible')) {
			if (activeNav.index() > previewSwiper.activeIndex) {
				var thumbsPerNav = Math.floor(previewSwiper.width / activeNav.width()) - 1
				previewSwiper.slideTo(activeNav.index() - thumbsPerNav)
			} else {
				previewSwiper.slideTo(activeNav.index())
			}
		}
	}
</script>

{include file=comm/foot.html}
